﻿using Easy.Services.DbContexts;
using Easy.Services.Entities;
using Easy.Services.Interface;
using System.Linq.Expressions;

namespace Easy.Services.Core
{
    internal class UserRoleRelationService: IUserRoleRelationService
    {

        public bool AddBatch(List<UserRoleRelation> relations)
        {
            using MySQLDbContext db = new();
            BaseService<UserRoleRelation> baseService = new(db);
            return baseService.AddBatchBase(relations);

        }


        public List<UserRoleRelation> GetList(Expression<Func<UserRoleRelation, bool>> expression = null)
        {
            using MySQLDbContext db = new();
            BaseService<UserRoleRelation> baseService = new(db);
            return baseService.GetList(expression);

        }

        public bool UpdateBatch(List<UserRoleRelation> relations)
        {
            using MySQLDbContext db = new();
            BaseService<UserRoleRelation> baseService = new(db);
            return baseService.UpdateBatchBase(relations);

        }

    }
}
